package sg.nus.iss.vmcs.controllers;

import sg.nus.iss.vmcs.models.Coin;


/**
 * Concrete Coin Handler that validates an input coin's weight against a standard coin <br><br>
 * Modifications:
 * 1/1/2011 - Philip - Refactored Class 
 * @author Raj
 * @author Philip
 */
public class ConcreteCoinHandler extends CoinHandler {
	/**
	 * Creates an instance of the Concrete Coin Handler
	 * @param stdCoin Reference to a std coin for comparison
	 */
	public ConcreteCoinHandler(Coin stdCoin) {
		super(stdCoin);
	}
	

	/**
	 * Actual Validation method that does checking
	 * @param weight Weight to check against
	 * @return True if coin is valid, false if otherwise
	 */
	protected boolean validateCoin(double weight) {
		return stdCoin.getWeight() == weight;
	}
}
